package com.example.app1;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import java.util.ArrayList;
import java.util.List;

public class SecondActivity extends AppCompatActivity {
    private List<String> list = new ArrayList<String>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_thread);
        for (int i=1;i<=20;i++){
            list.add(i+"");
        }
        ArrayAdapter<String> adapter = new  ArrayAdapter<String>(this,android.R.layout.simple_expandable_list_item_1,list);
        ListView lv = findViewById(R.id.list);
        lv.setAdapter(adapter);
    }
}